package com.example.bbs.ui.view.video;

import android.content.Context;
import android.util.AttributeSet;

import java.util.ArrayList;
import java.util.List;

import moe.codeest.enviews.ENPlayView;

public class ClickableENPlayView extends ENPlayView {

    List<OnClickListener> mOnClickListenerList = new ArrayList<>();

    public ClickableENPlayView(Context context) {
        super(context);

        super.setOnClickListener((v) -> {
            for (OnClickListener onClickListener : mOnClickListenerList) {
                onClickListener.onClick(v);
            }
        });
    }

    public ClickableENPlayView(Context context, AttributeSet attrs) {
        super(context, attrs);

        super.setOnClickListener((v) -> {
            for (OnClickListener onClickListener : mOnClickListenerList) {
                onClickListener.onClick(v);
            }
        });
    }

    @Override
    public void setOnClickListener(OnClickListener l) {
        mOnClickListenerList.add(l);
    }
}
